/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.src.uniandes.ecos.tsp.creditscore.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author AndhyMao
 */
@Entity
@Table(name = "tbl_cliente")
@NamedQueries({@NamedQuery(name = "Cliente.findAll", query = "SELECT c FROM Cliente c"), @NamedQuery(name = "Cliente.findByCliCodigo", query = "SELECT c FROM Cliente c WHERE c.cliCodigo = :cliCodigo"), @NamedQuery(name = "Cliente.findByCliNombre", query = "SELECT c FROM Cliente c WHERE c.cliNombre = :cliNombre"), @NamedQuery(name = "Cliente.findByCliApell1", query = "SELECT c FROM Cliente c WHERE c.cliApell1 = :cliApell1"), @NamedQuery(name = "Cliente.findByCliApell2", query = "SELECT c FROM Cliente c WHERE c.cliApell2 = :cliApell2"), @NamedQuery(name = "Cliente.findByCliFecnac", query = "SELECT c FROM Cliente c WHERE c.cliFecnac = :cliFecnac"), @NamedQuery(name = "Cliente.findByCliTipdoc", query = "SELECT c FROM Cliente c WHERE c.cliTipdoc = :cliTipdoc"), @NamedQuery(name = "Cliente.findByCliNumdoc", query = "SELECT c FROM Cliente c WHERE c.cliNumdoc = :cliNumdoc"), @NamedQuery(name = "Cliente.findByCliFecedo", query = "SELECT c FROM Cliente c WHERE c.cliFecedo = :cliFecedo"), @NamedQuery(name = "Cliente.findByCliTelres", query = "SELECT c FROM Cliente c WHERE c.cliTelres = :cliTelres"), @NamedQuery(name = "Cliente.findByCliHorcre", query = "SELECT c FROM Cliente c WHERE c.cliHorcre = :cliHorcre"), @NamedQuery(name = "Cliente.findByCliTelofi", query = "SELECT c FROM Cliente c WHERE c.cliTelofi = :cliTelofi"), @NamedQuery(name = "Cliente.findByCliHorcof", query = "SELECT c FROM Cliente c WHERE c.cliHorcof = :cliHorcof"), @NamedQuery(name = "Cliente.findByCliTelcel", query = "SELECT c FROM Cliente c WHERE c.cliTelcel = :cliTelcel"), @NamedQuery(name = "Cliente.findByCliHorcce", query = "SELECT c FROM Cliente c WHERE c.cliHorcce = :cliHorcce"), @NamedQuery(name = "Cliente.findByCliEmail", query = "SELECT c FROM Cliente c WHERE c.cliEmail = :cliEmail"), @NamedQuery(name = "Cliente.findByCliIngbme", query = "SELECT c FROM Cliente c WHERE c.cliIngbme = :cliIngbme"), @NamedQuery(name = "Cliente.findByCliDirres", query = "SELECT c FROM Cliente c WHERE c.cliDirres = :cliDirres"), @NamedQuery(name = "Cliente.findByCliBarres", query = "SELECT c FROM Cliente c WHERE c.cliBarres = :cliBarres"), @NamedQuery(name = "Cliente.findByNumDocAndTipoDoc", query = "SELECT c FROM Cliente c WHERE c.cliNumdoc = :cliNumdoc AND c.cliTipdoc = :cliTipdoc")})
public class Cliente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "cli_codigo")
    private Integer cliCodigo;
    @Column(name = "cli_nombre")
    private String cliNombre;
    @Column(name = "cli_apell1")
    private String cliApell1;
    @Column(name = "cli_apell2")
    private String cliApell2;
    @Column(name = "cli_fecnac")
    @Temporal(TemporalType.TIMESTAMP)
    private Date cliFecnac;
    @Column(name = "cli_tipdoc")
    private Integer cliTipdoc;
    @Column(name = "cli_numdoc")
    private String cliNumdoc;
    @Column(name = "cli_fecedo")
    @Temporal(TemporalType.TIMESTAMP)
    private Date cliFecedo;
    @Column(name = "cli_telres")
    private String cliTelres;
    @Column(name = "cli_horcre")
    private String cliHorcre;
    @Column(name = "cli_telofi")
    private String cliTelofi;
    @Column(name = "cli_horcof")
    private String cliHorcof;
    @Column(name = "cli_telcel")
    private String cliTelcel;
    @Column(name = "cli_horcce")
    private String cliHorcce;
    @Column(name = "cli_email")
    private String cliEmail;
    @Column(name = "cli_ingbme")
    private BigDecimal cliIngbme;
    @Column(name = "cli_dirres")
    private String cliDirres;
    @Column(name = "cli_barres")
    private String cliBarres;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "cliente")
    private Indagacion indagacion;
    @JoinColumn(name = "act_codigo", referencedColumnName = "act_codigo")
    @ManyToOne
    private Actividad actCodigo;
    @JoinColumns({@JoinColumn(name = "dep_codigo", referencedColumnName = "dep_codigo"), @JoinColumn(name = "mun_codigo", referencedColumnName = "mun_codigo"), @JoinColumn(name = "cep_codigo", referencedColumnName = "cep_codigo")})
    @ManyToOne
    private CentroPoblado centroPoblado;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "cliente")
    private List<ClienteProducto> clienteProductoList;

    public Cliente() {
    }

    public Cliente(Integer cliCodigo) {
        this.cliCodigo = cliCodigo;
    }

    public Integer getCliCodigo() {
        return cliCodigo;
    }

    public void setCliCodigo(Integer cliCodigo) {
        this.cliCodigo = cliCodigo;
    }

    public String getCliNombre() {
        return cliNombre;
    }

    public void setCliNombre(String cliNombre) {
        this.cliNombre = cliNombre;
    }

    public String getCliApell1() {
        return cliApell1;
    }

    public void setCliApell1(String cliApell1) {
        this.cliApell1 = cliApell1;
    }

    public String getCliApell2() {
        return cliApell2;
    }

    public void setCliApell2(String cliApell2) {
        this.cliApell2 = cliApell2;
    }

    public Date getCliFecnac() {
        return cliFecnac;
    }

    public void setCliFecnac(Date cliFecnac) {
        this.cliFecnac = cliFecnac;
    }

    public Integer getCliTipdoc() {
        return cliTipdoc;
    }

    public void setCliTipdoc(Integer cliTipdoc) {
        this.cliTipdoc = cliTipdoc;
    }

    public String getCliNumdoc() {
        return cliNumdoc;
    }

    public void setCliNumdoc(String cliNumdoc) {
        this.cliNumdoc = cliNumdoc;
    }

    public Date getCliFecedo() {
        return cliFecedo;
    }

    public void setCliFecedo(Date cliFecedo) {
        this.cliFecedo = cliFecedo;
    }

    public String getCliTelres() {
        return cliTelres;
    }

    public void setCliTelres(String cliTelres) {
        this.cliTelres = cliTelres;
    }

    public String getCliHorcre() {
        return cliHorcre;
    }

    public void setCliHorcre(String cliHorcre) {
        this.cliHorcre = cliHorcre;
    }

    public String getCliTelofi() {
        return cliTelofi;
    }

    public void setCliTelofi(String cliTelofi) {
        this.cliTelofi = cliTelofi;
    }

    public String getCliHorcof() {
        return cliHorcof;
    }

    public void setCliHorcof(String cliHorcof) {
        this.cliHorcof = cliHorcof;
    }

    public String getCliTelcel() {
        return cliTelcel;
    }

    public void setCliTelcel(String cliTelcel) {
        this.cliTelcel = cliTelcel;
    }

    public String getCliHorcce() {
        return cliHorcce;
    }

    public void setCliHorcce(String cliHorcce) {
        this.cliHorcce = cliHorcce;
    }

    public String getCliEmail() {
        return cliEmail;
    }

    public void setCliEmail(String cliEmail) {
        this.cliEmail = cliEmail;
    }

    public BigDecimal getCliIngbme() {
        return cliIngbme;
    }

    public void setCliIngbme(BigDecimal cliIngbme) {
        this.cliIngbme = cliIngbme;
    }

    public String getCliDirres() {
        return cliDirres;
    }

    public void setCliDirres(String cliDirres) {
        this.cliDirres = cliDirres;
    }

    public String getCliBarres() {
        return cliBarres;
    }

    public void setCliBarres(String cliBarres) {
        this.cliBarres = cliBarres;
    }

    public Indagacion getIndagacion() {
        return indagacion;
    }

    public void setIndagacion(Indagacion indagacion) {
        this.indagacion = indagacion;
    }

    public Actividad getActCodigo() {
        return actCodigo;
    }

    public void setActCodigo(Actividad actCodigo) {
        this.actCodigo = actCodigo;
    }

    public CentroPoblado getCentroPoblado() {
        return centroPoblado;
    }

    public void setCentroPoblado(CentroPoblado centroPoblado) {
        this.centroPoblado = centroPoblado;
    }

    public List<ClienteProducto> getClienteProductoList() {
        return clienteProductoList;
    }

    public void setClienteProductoList(List<ClienteProducto> clienteProductoList) {
        this.clienteProductoList = clienteProductoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cliCodigo != null ? cliCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Cliente)) {
            return false;
        }
        Cliente other = (Cliente) object;
        if ((this.cliCodigo == null && other.cliCodigo != null) || (this.cliCodigo != null && !this.cliCodigo.equals(other.cliCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.src.uniandes.ecos.tsp.creditscore.entity.Cliente[cliCodigo=" + cliCodigo + "]";
    }

}
